#ifndef BT_DATA_H
#define BT_DATA_H

/*
 *	bt_data.h
 *	Declares prototypes for binary tree data
 */

typedef struct _bt_data {
	char *key;
	int freq;
} * BTData;

typedef enum freqfield_t {
	FSTART = 0,
	FEND
} FreqField;

/* Create a new _bt_data element with a key; returns
 * a pointer to the element or null on failure. 
 */
BTData btdata_create (char *key, FreqField);

/* Free a _bt_data element, as well as the string inside
 * it.
 */
void btdata_free (BTData);

/* Compare two keys (case insensitive string compare), return
 * values are identical to strcmp. */
int btdata_keycmp (char *, char *);

/* Functions to increment the start or end frequency fields
 * when a collision occurs. */
void btdata_increment (BTData, FreqField);

#endif
